
<div class="breadcrumb"> <a href="index.html">Home</a> » <a href="#">Giỏ hàng</a> </div>
<h1><span class="h1-top">Giỏ hàng của bạn &nbsp;({$sum} sp) </span></h1>
<div class="cart-info">
  <table>
    <thead>
      <tr>
        <td class="image">Hình</td>
        <td class="name">Tên sản phẩm</td>
        <td class="model">Size</td>
        <td class="quantity">Số lượng</td>
        <td class="price">Đơn giá</td>
        <td class="total">Tổng tiền</td>
      </tr>
    </thead>
    <tbody>
    
    {foreach $smarty.session.cart as $k=>$cart_product}
    {foreach $cart_product as $key=>$value}
    <form action="/orders/cart_update.php" method="post" enctype="multipart/form-data">
      <tr>
        <td class="image"><a href="/products/detail.php?id={$k}"><img src="/upload/product/{$value.day_time|date_format:'%m-%Y'}/{$value.image}" alt="" title="" width="130" height="130" /></a></td>
        <td class="name"><a href="/products/detail.php?id={$k}">{$value.name}</a>
          <div> </div></td>
        <td class="model">{$value.size}</td>
        <input type="hidden" name="data[id]" value="{$k}" size="1" />
        <td class="quantity"><input type="text" name="data[quantity]" value="{$value.quantity}" size="1" /></td>
        <input type="hidden" name="data[size]" value="{$value.size}" size="1" />
        <td class="price">{number_format($value.price)}</td>
        <td class="total">{number_format($value.into_money)}
          <div class="reload">
            <input type="image" src="/templates/images/reload.png" alt="Update" title="Update" name="submit"/>
            &nbsp; &nbsp;<a href="/orders/cart_delete.php?id={$k}&k={$key}"><img src="/templates/images/del.png" alt="Remove" title="Remove" /></a> </div></td>
      </tr>
    </form>
    {/foreach}
    {/foreach}
      </tbody>
    
  </table>
</div>
<h2>Bạn vui lòng kiểm tra lại giỏ hàng trước khi thanh toán!</h2>
<div class="cart-total">
  <table id="total">
    <tbody>
      <tr>
        <td class="right"><b>Tổng tiền:</b></td>
        <td class="right last">{if count($smarty.session.cart) > 0}{number_format($smarty.session.sum_of_money)}{else}0&nbsp;{/if} VNĐ</td>
      </tr>
      <tr>
        <td class="right"><b>VAT (10):</b></td>
        <td class="right last">10% VNĐ</td>
      </tr>
      <tr>
        <td class="right lastrow"><b>Thành tiền:</b></td>
        <td class="right last lastrow">{if count($smarty.session.cart) > 0}{number_format($smarty.session.sum_of_money+$smarty.session.sum_of_money*10/100)}{else}0&nbsp;{/if} VNĐ</td>
      </tr>
    </tbody>
  </table>
</div>
<div class="buttons">
  <div class="right"><a href="/payment/payment.php" class="button">Thanh toán</a></div>
  <div class="center"><a href="/home/home.php" class="button">Tiếp tực mua hàng</a></div>
</div>
